package com.yydream.dto;

import com.yydream.common.valid.AddGroup;
import com.yydream.common.valid.ListValue;
import com.yydream.common.valid.UpdateGroup;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

@Data
public class SysRoleDTO extends BaseDTO implements Serializable {

    @ApiModelProperty(name = "角色id",notes = "")
    @NotNull(message = "不能为空", groups = { UpdateGroup.class })
    private Long id ;

    @ApiModelProperty(name = "角色名称",notes = "")
    @NotEmpty(message = "名称不能为空", groups = {AddGroup.class})
    private String name ;

    @ApiModelProperty(name = "角色状态",notes = "（1：启动，2：禁用）")
    @NotNull(message = "角色状态不能为空", groups = {AddGroup.class})
    @ListValue(value = {1, 2}, message = "状态只能是：（1：启动，2：禁用）", groups = { AddGroup.class, UpdateGroup.class})
    private Integer state ;
}
